#

from multiprocessing import Process
import os
import multiprocessing


def info(title):
    print(title)
    print('module name:', __name__)
    print('parent process:', os.getppid())
    print('process id:', os.getpid())


def f(name):
    info('function f')
    print('hello', name)


def f1(name):
    info('function f1')
    print('hello', name)


# if __name__ == '__main__':
#     info('main line')
#     p = Process(target=f, args=('bob',))
#     p.start()
#     p.join()
print(multiprocessing.cpu_count())
if __name__ == '__main__':
    info('main line')
    p = Process(target=f, args=('bob',))
    p.start()
    p.join()
    print('--------------')
    p1 = Process(target=f1, args=('cc',))
    p1.start()
    p1.join()
